def rbac_required(roles=None, admin_only=False):
	"""Simple RBAC decorator placeholder for future extension.

	Currently, heavy lifting is done in endpoints by checking user.is_admin
	This decorator can be extended to check roles/status.
	"""
	roles = roles or []

	def decorator(fn):
		def wrapper(*args, **kwargs):
			return fn(*args, **kwargs)
		return wrapper

	return decorator


def make_response(data=None, code: int = 200, msg: str = "OK"):
	return {"code": code, "msg": msg, "data": data}, code


def make_paginated(items, total: int, page_num: int, page_size: int):
	data = {
		"items": items,
		"total": total,
	}
	# 当数据量超过 page_size 时，包含 page_num
	if total > page_size:
		data["page_num"] = page_num
		data["page_size"] = page_size
	return data


